package com.oe.market.modules.ele.model.mapper;

import com.oe.market.modules.ele.model.bean.Account;
import com.oe.market.modules.ele.model.dto.EleAccountDto;

public class EleAccountMapper {
    protected Account account;

    public EleAccountMapper(Account account) {
        this.account = account;
    }

    public Account getAccount() {
        return account;
    }

    public EleAccountDto getEleAccountDto() {
        EleAccountDto eleAccountDto = new EleAccountDto();
        eleAccountDto.use = account.use;
        eleAccountDto.balance = account.maxUse - account.use;
        eleAccountDto.lastUseTime = account.lastUseTime;
        eleAccountDto.todayUse = account.todayUse;
        eleAccountDto.phone = account.phone;
        eleAccountDto.bindCookie = account.getCookieId() != null;
        return eleAccountDto;
    }
}
